/**
 * @file main.cpp
 * @brief Main file for library's tests
 *
 *
 **/
#include <iostream>
#include <cstdlib>
#include "wolf.hpp"
#include "tests.hpp"
#include <exception>

///////////////////////////////////
// Change it by you choosen test //
///////////////////////////////////
#ifndef WOLF_CHOOSEN_TEST
#define WOLF_CHOOSEN_TEST ActorEventTest
#endif

using namespace std;
using namespace wolf;

int main(int argc, char** argv) {
	//Initliazing sdl and ttf
	try {
		Engine::prepare();
	} catch (SdlError &e) {
		cerr << "Unable to initialize: " << e.what() << endl;
		return EXIT_FAILURE;
	}

	Test *test = new WOLF_CHOOSEN_TEST;
	SDL_WM_SetCaption(("Testing " + test->name()).c_str(), NULL);

	try {
		if (test->run()) {
			delete test;
			return EXIT_SUCCESS;
		} else {
			delete test;
			return EXIT_FAILURE;
		}
	} catch (exception &e) {
		cerr << "Something went wrong:" << endl << "\t" << e.what() << endl;
		return EXIT_FAILURE;
	}
}
